
CXX = g++
FLAGS = -O3 -Wall

# weightsScheme.o 

OBJFILES = main.o arcball.o glDrawFunctions.o \
				core/constraints.o core/deformation.o \
				meshdef/mesh.o meshdef/deformationMesh.o \
				meshdef/weightsScheme.o
###################################################################
all: subdirs mlsmeshdef 

subdirs:
	cd core && $(MAKE) 
	cd meshdef && $(MAKE) 

mlsmeshdef: $(OBJFILES)
	@echo "Linking ...."
	$(CXX) -o $@ $^ -lGL -lGLU -lglut -lCGAL -llapack 

.cpp.o: $*.h
	@echo "Compiling C++ code ...."
	$(CXX) -c $(FLAGS) $*.cpp

clean: 
	rm *.o 
	cd core && $(MAKE) clean
	cd meshdef && $(MAKE) clean

main.o: main.cpp atmatrix.h selection.h
arcball.o: arcball.cpp arcball.h
glDrawFunctions.o: glDrawFunctions.cpp glDrawFunctions.h
#weightsScheme.o: weightsScheme.h weightsScheme.cpp
